// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.Security;

public sealed partial class ClearApiKeyCacheRequestParameters : RequestParameters
{
}

/// <summary>
/// <para>
/// Evicts a subset of all entries from the API key cache.
/// The cache is also automatically cleared on state changes of the security index.
/// </para>
/// </summary>
public sealed partial class ClearApiKeyCacheRequest : PlainRequest<ClearApiKeyCacheRequestParameters>
{
	public ClearApiKeyCacheRequest(Elastic.Clients.Elasticsearch.Serverless.Ids ids) : base(r => r.Required("ids", ids))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityClearApiKeyCache;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "security.clear_api_key_cache";
}

/// <summary>
/// <para>
/// Evicts a subset of all entries from the API key cache.
/// The cache is also automatically cleared on state changes of the security index.
/// </para>
/// </summary>
public sealed partial class ClearApiKeyCacheRequestDescriptor : RequestDescriptor<ClearApiKeyCacheRequestDescriptor, ClearApiKeyCacheRequestParameters>
{
	internal ClearApiKeyCacheRequestDescriptor(Action<ClearApiKeyCacheRequestDescriptor> configure) => configure.Invoke(this);

	public ClearApiKeyCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids ids) : base(r => r.Required("ids", ids))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityClearApiKeyCache;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "security.clear_api_key_cache";

	public ClearApiKeyCacheRequestDescriptor Ids(Elastic.Clients.Elasticsearch.Serverless.Ids ids)
	{
		RouteValues.Required("ids", ids);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}